<template>
  <div class="mid-top com-flex">
    <div class="mid-top-title">总数（个）</div>
    <div class="mid-top-num">
      <slot></slot>
    </div>
    <span class="line1"></span>
    <span class="line2"></span>
    <span class="line3"></span>
    <span class="line4"></span>
  </div>
</template>

<script setup></script>

<style lang="scss" scoped>
.mid-top {
  width: 322px;
  height: 86px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border: 1px solid #66b6fe;
  position: relative;
  .mid-top-title {
    margin-bottom: 8px;
    color: #fff;
    font-size: 16px;
    height: 24px;
    line-height: 24px;
  }
}

.line1 {
  position: absolute;
  top: -2px;
  left: -2px;
  width: 23px;
  height: 23px;
  border-left: 4px solid #66b6fe;
  border-top: 4px solid #66b6fe;
  transition: all 0.8s;
}
.line2 {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 23px;
  height: 23px;
  border-right: 4px solid #66b6fe;
  border-top: 4px solid #66b6fe;
  transition: all 0.8s;
}
.line3 {
  position: absolute;
  bottom: -2px;
  left: -2px;
  width: 23px;
  height: 23px;
  border-left: 4px solid #66b6fe;
  border-bottom: 4px solid #66b6fe;
  transition: all 0.8s;
}
.line4 {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 23px;
  height: 23px;
  border-right: 4px solid #66b6fe;
  border-bottom: 4px solid #66b6fe;
  transition: all 0.8s;
}

/* 公共线条样式 */
.com-flex:hover .line1 {
  border-left: 4px solid #66b6fe;
  border-top: 4px solid #66b6fe;
  width: calc(100% + 2px);
  height: 0;
}
.com-flex:hover .line2 {
  border-right: 4px solid #66b6fe;
  border-top: 4px solid #66b6fe;
  width: 0;
  height: calc(100% + 2px);
}
.com-flex:hover .line3 {
  width: 0;
  height: calc(100% + 2px);;
}
.com-flex:hover .line4 {
  width: calc(100% + 2px);
  height: 0;
}
.com-flex:hover {
  background-color: rgba($color: #000000, $alpha: 0.2);
}
.com-flex:hover .com-title {
  background-color: lighten($color: #4e99e0, $amount: 20%);
}
</style>
